package com.qst.web;

import com.qst.po.Clazz;
import com.qst.po.PageData;
import com.qst.service.IClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ClazzController {
    @Autowired
    private IClazzService clazzService;
    @RequestMapping("toclassquslist")
    private String toclasslist(){
        return "classquslist";
    }
    @RequestMapping("classlist")
    @ResponseBody
    public PageData<Clazz> classlist(int tid,int page ,int limit){
        PageData<Clazz> data =new PageData();
        int totalcount=clazzService.gettotalcount(tid);
        List<Clazz> clazzs =clazzService.getclazzsbypagetid(tid,page,limit);
        data.setCode(0);
        data.setMsg("");
        data.setCount(totalcount);
        data.setData(clazzs);
        return data;
    }
    @RequestMapping("toteaclasslist")
    private String toteaclasslist(){
        return "teaclasslist";
    }
}
